package com.wzx.modules.menu.controller;


import com.wzx.modules.menu.entity.Menu;
import com.wzx.modules.menu.entity.MenuVo;
import com.wzx.modules.menu.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 菜单表 前端控制器
 * </p>
 *
 * @author wzx
 * @since 2023-03-15
 */
@Api(tags = "菜单接口")
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @ApiOperation("新增菜单")
    @PostMapping("/save")
    public void save(@RequestBody MenuVo vo){
        Menu menu = new Menu();
        BeanUtils.copyProperties(vo,menu);
        menuService.save(menu);
    }
}

